﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Funciones
{
    partial class connection
    {
        public SqlConnection con = new SqlConnection();

        public bool CrearConexion(string dirServer, string nombreDB, string usuario, string clave)
        {
            string CadenaConexionSA;
            string CadenaConexionWin;

            CadenaConexionSA = "data source=" + dirServer +
                            ";" + "initial catalog= " + nombreDB +
                            ";user id=" + usuario + ";password=" + clave;

            CadenaConexionWin = "data source=" + dirServer +
                            ";" + "initial catalog= " + nombreDB +
                            ";Integrated Security = True";
            try
            {
                con = new SqlConnection(CadenaConexionWin);
                con.Open();
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
    }
    partial class General
    {
        public static string Server = @"CESAR\SQLEXPRESS";
        public static string DataBase = "Todo390";
        public static string User = "root";
        public static string Pass = "";
    }
}
